<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
	<title>SchemeScript Preferences</title>
    <link href="schemescript.css" rel="stylesheet" type="text/css">
</head>

<body>
<h1>Preferences</h1>

<p>
	The Scheme preference pages are used to configure various aspects of
	the Scheme editor and it's integration with a Scheme interpreter.
</p>

<a href="#main">Scheme - main page</a></br>
<a href="#appear">Appearance</a><br>
<a href="#comments">Comments</a><br>
<a href="#interp">External Interpreter</a><br>
<a href="#fasteval">Fast Eval Keys</a><br>
<a href="#indent">Indentation</a><br>
<a href="#lexical">Lexical Extensions</a><br>
<a href="#remote">Remote Interpreter</a><br>
<a href="#syntax">Syntax</a><br>


<h2><a name="main">Scheme - main page</a></h2>
<p>
	This page controls the tab size width, and allows the serialization
	of a subset of the preferences, namely those relating to syntax
	and indentation (those that are usually shared between members
	of a development team).
</p>
<center><img src="images/schemeprefs.JPG"/></center>

<h2><a name="appear">Appearance</a></h2>
<p>
	The <i>Appearance</i> page controls the appearance of the various tokens
	in a Scheme source file, as well as the background color, and the
	way matching parentheses are highlighted.
</p>
<center><img src="images/appearprefs.JPG"/></center>

<h2><a name="comments">Comments</a></h2>
<p>
	The <i>Comments</i> page are used to customize comment-related features:
	<ul>
		<li>the comment prefix inserted when lines are commented out;</li>
		<li>the author name and copyright added to header comments (inserted by the
			<i>Scheme file header comment</i> command);</li>
		<li>a flag indicating whether hitting Enter in a comment makes
			the comment continue on the next line.</li>
	</ul>
</p>
<center><img src="images/commentprefs.JPG"/></center>

<h2><a name="interp">External Interpreter</a></h2>
<p>
	The External Interpreter preference page is used to configure an external Scheme interpreter 
	with which the Scheme editor interacts (as opposed to the embedded Kawa interpreter).
</p>
<center><img src="images/interpreter.JPG"/></center>
<p>
	To set up a Scheme interpreter, you must minimally provide:
	<ul>
		<li>the interpreter's name,</li>
		<li>the command line to start the interpreter, and</li>
		<li>the directory where the interpreter is started.</li>
	</ul>
</p>
<p>
    The specification of the working directory can include
    variables, as described 
    <a href="http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.user/concepts/concepts-exttools.htm">here</a>.
</p>
<p>
	Also, you can specify a regular expression that will be matched 
	against all lines in the console window to detect error messages
	with their corresponding file name and line number (the location 
	of the error). Simply enter a valid (Java) regular expression in 
	the field named <b>Error Regexp</b>, taking care to have a group 
	that matches the filename, another group that matches the
	line number, and a third group that matches the part of the line
	that should be highlighted as an hyperlink. 
</p>
 <p>
	Here are a few configurations for some Scheme interpreters:
	<table>
		<tr><th>Interpreter</th><th width="60%">Error Regexp</th><th>Filename</th><th>Line</th><th>Link</th></tr>
		<tr><td>MzScheme (with errortrace)</td>
			<td><code>((([a-z]:)?[^:]+):([0-9]+):[0-9]+): .*</code></td>
			<td align=center>2</td>
			<td align=center>4</td>
			<td align=center>1</td></tr>
		<tr><td>Kawa </td>
			<td><code>[\t ]+at [^(]+\(((.+):([0-9]+))\)</code></td>
			<td align=center>2</td>
			<td align=center>3</td>
			<td align=center>1</td></tr>
	</table>
	Note that with Kawa, files must be loaded by giving their full path name.
 </p>

<h2><a name="fasteval">Fast Eval Keys</a></h2>
<p>
	You can configure the Fast Eval keys using the Fast Eval preference page:
</p>
<center><img src="images/fasteval.JPG"/></center>

<h2><a name="indent">Indentation</a></h2>
<p>
	Indentation is a crucial part of a Scheme editor. The <i>Indentation</i> 
	page controls how sub-expressions are indented. To be easily readable by
	others, Scheme code indentation must obey strict, standard rules.
</p>
<center><img src="images/indentprefs.JPG"/></center>
<p>	
	The page shows a three column table, with
	some controls above it to add/remove entries in the table. Each entry corresponds to
	a Scheme symbol and tells the editor how to indent expressions directly inside
	S-expressions starting with this symbol. 
</p>
<p>
	The columns in the table are:
	<ul>
		<li><i>Name</i></li> - the symbol;
		<li><i>Indentation scheme</i> - tells how sub-expressions are indented. The possible
			values are:
			<ul>
				<li><b>default</b> - all sub-expressions are indented below the first symbol of
					the enclosing expression;</li>
				<li><b>definition</b> - all sub-expressions are indented as the enclosing
					expression plus 2 spaces (like most defining forms).</li>
				<li><b>if</b> - all sub-expressions are indented as the enclosing
					expression plus 4 spaces (like an <code>if</code> special form).</li>
				<li><b>sequence</b> - all sub-expressions are indented as the
					enclosing expression plus 2 spaces (like in a <code>begin</code> special
					form).</li>
				<li><b>with</b> - this is the most complex and general scheme. It is used to
					control the proper indentation of calls to functions like <code>with-input-from-file</code>,
					for example. Thus it's name. In such function calls, the first <i>N</i> parameters
					are indented of 4 spaces, while the others are indented of 2 spaces. This number, 
					<i>N</i>, is called the <i>hint</i>, and is specified in the third column.
				<li><b>none</b> - no indentation at all, all sub-expressions are indented at
					the same level as the enclosing expression (this is quite unusual in
					Scheme, but can be used to circumvent the indentation of top-level
					definitions in PLT-style modules).</li>
			</ul>
			</li>
		<li><i>Hint</i> - when the indentation scheme is set to <b>with</b>, this number 
			controls how many sub-expressions are indented of 4 spaces.</li>
	</ul>
</p>

<h2><a name="lexical">Lexical extensions</a></h2>
<p>
	Lexical extensions are flags that can be set to change how some tokens are 
	processed in the Scheme source file. 
</p>
<center><img src="images/lexicalprefs.JPG"/></center>
<p>
	These flags are:
	<ul>
		<li><i>Treat brackets as parentheses</i> - some Scheme systems treat
			square brackets as parentheses (PLT Scheme, SISC, etc), some don't 
			(e.g. Kawa). Use this flag to ensure correct parsing and proper
			parenthesis matching.</li>
		<li><i>Accept dash as identifier part</i> - some Scheme systems allow
			dashes as part of identifier. Use this flag to ensure correct parsing.</li>
	</ul> 
</p>

<h2><a name="remote">Remote Interpreter</a></h2>
<p>
   The <i>Remote Interpreter</i> page is used to set the hostname and the port number
   to be used to connect to a remote interpreter.
</p>
<center><img src="images/remoteinterp.JPG"/></center>

<h2><a name="syntax">Syntax</a></h2>
<p>
	The <i>Syntax</i> page is used to categorize symbols. These categories are used when
	coloring the various symbols in a source file. Symbols not appearing in any of these
	lists are colored using the default color and attributes.
</p>
<p>
	A regular expression can also be used to assign symbols to the various categories.
	The regular expression must be entered in the text field below the list box.
</p>
<center><img src="images/syntaxprefs.JPG"/></center>

<hr/>
<p>
	Copyright (C) 2004-2006 <b>Dominique Boucher</b>.
</p>
</body>
</html>